package top.appx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import top.appx.service.ArticleService;
import top.appx.service.FolderService;
import top.appx.vo.ArticleVO;
import top.appx.vo.FolderVO;
import top.appx.vo.Pager;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by zwy on 2015-5-22.
 */
@Controller
public class HomeController {

    @Resource
    private ArticleService articleService;

    @Resource
    private FolderService folderService;

    @RequestMapping(value="/home")
    public String home(HttpServletRequest request){
        List<ArticleVO> avList = articleService.homeList();
        request.setAttribute("avList",avList);
        List<ArticleVO> avNewestList = articleService.homeNewest();
        request.setAttribute("avNewestList",avNewestList);

        List<FolderVO> fvList = folderService.queryAll();
        request.setAttribute("fvList",fvList);
        return "home";
    }


}
